package Java8实战._1_Lambda._5_定义接口对选择建模;

import Java8实战._1_Lambda.Apple;

public class AppleFancyFormatter implements AppleFormatter{
    @Override
    public String accept(Apple apple) {

        String str = apple.getWeight() >= 150 ? "heavy" : "light";

        return "A " + str + " ," + apple.getColor() + " apple";
    }
}
